package com.example.diagnodroid.memoire;


import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

import com.example.diagnodroid.R;

@SuppressLint("NewApi")
public class PerfProcessorActivity extends Activity {
	
	SystemUtils systemUtils;
	TextView infoPerfText;
	
	int current_frequency;
	int max_frequency;
	int min_frequency;
	
    
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.perf_processor_layout);

		infoPerfText = (TextView) findViewById(R.id.info_perf_processor);

		try {	
			
			min_frequency = SystemUtils.getCPUFrequencyMin()/1000;
			max_frequency = SystemUtils.getCPUFrequencyMax()/1000;
			current_frequency = SystemUtils.getCPUFrequencyCurrent()/1000;
			
			
			infoPerfText.append("\n Frequence max : " + max_frequency + " MHz\n Frequence min : " + min_frequency 
					+ " MHz\n Frequence actuelle : " + current_frequency + " MHz \n\n");
			
			infoPerfText.append(SystemUtils.getCPUinfo());
			

			
					
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}


}